Colour Management in ASCII MADNESS II
-------------------------------------

ASCII MADNESS used a really crap colour system - 64 different colours were loaded
into an 8x8 array. "Colours" refers to a CHAR_INFO element, where the combination
of a character and FOREGROUND_/BACKGROUND_ colours provided a sort of "pixel"
colour on the screen. ASCII MADNESS had 8 hues and each hue had 8 different shades.

AM2* uses a completely different system. Rather than guess that there were 64 different
colours, I firstly took a screengrab of a console window display every combination of
FOREGROUND_ and BACKGROUND_ colours for each of our 3 different dither blocks
(characters 0xB0 to 0xB2). See RAW.PNG in the \ASCII Graphics Editor\bin folder.
Each 8x8 block was averaged out to a single RGB value, which was then compared to a list
of all the other RGB values collected (to eliminate duplicates) and then saved to a
palette file containing the character, FOREGROUND_/BACKGROUND_ colour attributes and
the averaged RGB value. When converting images for use in this app, each pixel is 
converted to an index on the palette based on the closest RGB match. See "File Formats.txt"
for more information on the .PAL palette format and .SPR graphic format.

The palette is accessible via the array of shorts "palette". To be able to perform
operations on individual pixels it made sense to create a colour map. This is a large
array 256 times the size of the palette. Each palette entry is followed by a list of
256 other palette values fading the colour to black. For example, if palette entry 23
was a bright red, we could get the palette index of a colour that was half as bright
by:
	short half_bright_red = colour_map[ (23*256) + 128 ];
	                                       ^        ^
	We need to multiply by 256 to get _____|        |_ 128 is half way along the table
	      the starting index.                                so is half as bright.
This is faintly similar to the way DOOM handled the COLORMAP.



*AM2 = ASCII Madness Two. NOT Albatross Ministers [Part] Two, a fantastic film if you ever
get the chance to see it.